package utils;

import java.io.File;
import static utils.Constants.*;

/**
 * @author Eduardo Rosales
 * Responsible for getting the local jar path
 */
public class JarPath {
    /**
     * Responsible for getting the local jar path as a String
     * @return
     */
    public static String getJarPath() {
        File jarPath = new File(JarPath.class.getProtectionDomain().getCodeSource().getLocation().getPath());
        String jarCanonicalPath = jarPath.toString();
        jarCanonicalPath = jarCanonicalPath.replaceAll(JAR_NAME, "");
        return jarCanonicalPath;
    }
}//end of JarPath
